<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1.函数声明
        function fn1 (sum1, sum2){
            return sum1  + sum2
        }
        console.log('函数fn1：' , fn1(1,2))

        // 2.函数表达式
        var fn2 = function(sum1,sum2) {
            return sum1 + sum2
        }
        console.log('函数fn2：' , fn2(2,3))

        // 3.函数对象
        var fn3 = new Function('sum1', 'sum2', 'return sum1+sum2')
        console.log('函数fn3：' , fn3(6,8))
    </script>
    
</body>
</html>